/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSky.matcher.builder;

import java.util.Collection;
import org.hamcrest.Matcher;
import ru.jSky.interfaces.Armor;
import ru.jSky.matcher.builder.major.ArmorMatcherBuilder;
import ru.jSky.producer.Producer;
import ru.jSky.producer.builder.CollectionProducerBuilder;
import ru.jSky.producer.builder.CompositeProducerBuilder;
import ru.jSky.producer.builder.major.ArmorProducerBuilder;

/**
 *
 * @author Rakev
 */
public class CollectionMatcherBuilder<F, C extends Collection<E>, E> extends ObjectMatcherBuilder<F, C> {

    public static <C extends Collection<E>, E> CollectionMatcherBuilder<C, C, E> create() {
        return new CollectionMatcherBuilder<>(CollectionProducerBuilder.<C,E>create());
    }
    
    public CollectionMatcherBuilder(CompositeProducerBuilder<F, C> producerBuilder) {
        super(producerBuilder);
    }

    public Matcher<F> anyOf(Matcher<E> elementMatcher) {
        Producer<F, C> collectionProducer = getProducerBuilder().build();
        return getAdapterMatcherFactory().<F, C, E>createAnyOf(collectionProducer, elementMatcher);
    }
}
